home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / varia / interp18.lha / interp-1.8 / Makefile < prev    next >
Makefile  |  1990-02-07  |  6KB  |  176 lines

  1. # Makefile -- the descriptiong of how to build Interp.
  2. # Copyright (C) 1989 Carey Richard Murphey.
  3. # (rich@rice.edu) 5310 Rutherglenn, Houston, TX 77096
  4.  
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 1, or (at your option)
  8. # any later version.
  9.  
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14.  
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. OPT=-g -fsave-memoized -fno-defer-pop -Wall
  20. C++=g++
  21. CC=g++
  22. C++FLAGS = $(OPT) -pipe
  23. LDLIBS =  -lm 
  24. LDFLAGS =  $(OPT) -v -g
  25. # lex and yacc won't work with g++.  Use flex and bison.
  26. YACC = bison
  27. YFLAGS = -v -d -y -l
  28. LEX = flex
  29. LFLAGS = -L # -cF
  30. #----------------------------------------------------------------
  31. .PHONY : test dist default
  32. default : interp TAGS test
  33.  
  34. M=AVLMap
  35. interp : Node.Plex.o Node.XPlex.o
  36. # interp needs Ast.o, Symbol.o and Context.o only if -O is not used.
  37. interp : Ast.o Symbol.o Context.o
  38. interp : Table.Plex.o Table.XPlex.o
  39. interp : String.Symbolp.Map.o String.Symbolp.$(M).o
  40. interp : parser.o util.o lexer.o interp.o
  41.  
  42. lexer.cc : lexer.l
  43.     $(LEX.l) $< > $*.cc
  44. parser.cc y.tab.h : parser.y
  45.     $(YACC.y) $<
  46.     mv -f y.tab.c $*.cc
  47. #----------------------------------------------------------------
  48. #
  49. # Type `make test' to test interp.  It will respond `PASSED' if
  50. # interp passes a simple regression test.
  51. #
  52. # You should have a copy of input.cc and sample.output from the distriburion.
  53. #
  54. #    Ignore FAILED, if only the roundoff error in the last digits differ.
  55. #
  56. test : interp
  57.     -./interp <input.cc >interp.output 2>&1
  58.     @echo
  59.     @echo -n The regression test of "interp "
  60.     -@diff interp.output sample.output >diff && echo PASSED.\
  61.          || (echo FAILED.; cat diff)
  62.     @echo
  63.     @echo If the regression test passed, you have successfully built Interp.
  64. #
  65. # You should already have a copy of sample.output from the distribution.
  66. # This is how it is made for the distribution:
  67. #
  68. sample.output :
  69.     -./interp <input.cc >sample.output 2>&1
  70. #----------------------------------------------------------------
  71. # the container classes:
  72. #
  73. # try to change val to ref sometime!
  74. String.Symbolp.Map.h String.Symbolp.Map.cc : String.defs.h
  75.     genclass -2 String val Symbolp val Map
  76. String.Symbolp.$(M).h String.Symbolp.$(M).cc : String.defs.h
  77.     genclass -2 String val Symbolp val $(M)
  78.  
  79. Table.Plex.h Table.Plex.cc : Table.defs.h
  80.     genclass Table val Plex
  81. Table.XPlex.h Table.XPlex.cc : Table.Plex.h
  82.     genclass Table val XPlex
  83.  
  84. Node.Plex.h Node.Plex.cc : Node.defs.h
  85.     genclass Node val Plex
  86. Node.XPlex.h Node.XPlex.cc : Node.Plex.h
  87.     genclass Node val XPlex
  88. #----------------------------------------------------------------
  89. # use `make dist' to bundle the distribution
  90. #
  91. SRC = interp.cc String.defs.h parser.y parser.h lexer.l util.cc \
  92.   Symbol.cc Ast.h Context.h Context.cc Node.defs.h Table.defs.h \
  93.   Ast.cc Symbol.h
  94. OTHER = Makefile .gdbinit input.cc ChangeLog tst.cc interp.texinfo \
  95.   README sample.output
  96. DIST = $(SRC) $(OTHER)
  97. DISTDIR = /qed/ftp/pub/
  98. DISTNAME = interp-1.8
  99.  
  100. dist : $(DISTDIR)$(DISTNAME).tar.Z
  101. dist : $(SRC) $(OTHER)
  102. CHECKSUMS : $(DIST)
  103.     echo CHECKSUMS >CHECKSUMS
  104.     sum $(DIST) >>CHECKSUMS
  105.     echo source size >>CHECKSUMS
  106.     wc $(SRC) >>CHECKSUMS
  107.     echo total sizes >>CHECKSUMS
  108.     wc $(DIST) >>CHECKSUMS
  109.  
  110. $(DISTDIR)$(DISTNAME).tar.Z : $(DIST) CHECKSUMS
  111.     -$(RM) -rf t
  112.     mkdir t
  113.     mkdir t/$(DISTNAME)
  114.     ln $(DIST) CHECKSUMS t/$(DISTNAME)
  115.     cd t; tar cfz ../$(DISTNAME).tar.Z $(DISTNAME)
  116.     mv $(DISTNAME).tar.Z $(DISTDIR)
  117.     rm -rf t
  118. #
  119. # I use `make testdist' to make sure the distribution is bundled correctly.
  120. #
  121. testdist : $(DISTDIR)$(DISTNAME).tar.Z
  122.     -$(RM) -rf $(DISTDIR)
  123.     tar xfz $(DISTDIR)$(DISTNAME).tar.Z
  124.     cd $(DISTNAME); make -k
  125.     -$(RM) -rf $(DISTDIR)
  126. #----------------------------------------------------------------
  127. clean :
  128.     rm *.o TAGS lexer.cc parser.cc String.Symbol* y.* *~ \#* \
  129.       CHECKSUMS Table.*Plex* Node.*Plex*
  130. TAGS :
  131.     etags -f TAGS $(SRC)
  132. #----------------------------------------------------------------
  133. # dependencies:
  134. #
  135. depend::
  136.     mv Makefile Makefile.bak
  137.     sed -e "/^# DO NOT DELETE THIS LINE/,$$ d" <Makefile.bak >Makefile
  138.     echo "# DO NOT DELETE THIS LINE"  >>Makefile
  139.     $(C++) $(C++FLAGS) -MM *.cc >>Makefile
  140.     echo "# make depend DELETES ANYTHING AFTER THIS LINE."  >>Makefile
  141. #----------------------------------------------------------------
  142. # DO NOT DELETE THIS LINE
  143. Ast.o : Ast.cc Ast.h Context.h Table.XPlex.h Table.Plex.h Table.defs.h \
  144.   String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h Symbol.h \
  145.   Symbol.cc Context.cc Ast.cc 
  146. Context.o : Context.cc Context.h Table.XPlex.h Table.Plex.h Table.defs.h \
  147.   String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h Symbol.h \
  148.   Symbol.cc Context.cc 
  149. String.Symbolp.AVLMap.o : String.Symbolp.AVLMap.cc String.Symbolp.AVLMap.h \
  150.   String.Symbolp.Map.h String.defs.h Symbol.h Symbol.cc 
  151. String.Symbolp.Map.o : String.Symbolp.Map.cc String.Symbolp.Map.h \
  152.   String.defs.h Symbol.h Symbol.cc 
  153. Symbol.o : Symbol.cc Symbol.h Symbol.cc 
  154. Table.Plex.o : Table.Plex.cc Table.Plex.h Table.defs.h \
  155.   String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h Symbol.h \
  156.   Symbol.cc 
  157. Table.XPlex.o : Table.XPlex.cc Table.XPlex.h Table.Plex.h Table.defs.h \
  158.   String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h Symbol.h \
  159.   Symbol.cc 
  160. input.o : input.cc 
  161. interp.o : interp.cc 
  162. lexer.o : lexer.cc parser.h Ast.h Context.h Table.XPlex.h Table.Plex.h \
  163.   Table.defs.h String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h \
  164.   Symbol.h Symbol.cc Context.cc Ast.cc y.tab.h 
  165. parser.o : parser.cc parser.h Ast.h Context.h Table.XPlex.h Table.Plex.h \
  166.   Table.defs.h String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h \
  167.   Symbol.h Symbol.cc Context.cc Ast.cc 
  168. t.o : t.cc String.defs.h Symbol.h Symbol.cc Ast.h Context.h Table.XPlex.h \
  169.   Table.Plex.h Table.defs.h String.Symbolp.AVLMap.h String.Symbolp.Map.h \
  170.   Context.cc Ast.cc 
  171. tst.o : tst.cc 
  172. util.o : util.cc parser.h Ast.h Context.h Table.XPlex.h Table.Plex.h \
  173.   Table.defs.h String.Symbolp.AVLMap.h String.Symbolp.Map.h String.defs.h \
  174.   Symbol.h Symbol.cc Context.cc Ast.cc 
  175. # make depend DELETES ANYTHING AFTER THIS LINE.
  176.